package com.zrspring.libv2.view.adview;

import android.support.v4.view.ViewPager.PageTransformer;

import com.zrspring.libv2.view.adview.animation.AccordionTransformer;
import com.zrspring.libv2.view.adview.animation.BackgroundToForegroundTransformer;
import com.zrspring.libv2.view.adview.animation.CubeInTransformer;
import com.zrspring.libv2.view.adview.animation.CubeOutTransformer;
import com.zrspring.libv2.view.adview.animation.DefaultTransformer;
import com.zrspring.libv2.view.adview.animation.DepthPageTransformer;
import com.zrspring.libv2.view.adview.animation.FlipHorizontalTransformer;
import com.zrspring.libv2.view.adview.animation.FlipVerticalTransformer;
import com.zrspring.libv2.view.adview.animation.ForegroundToBackgroundTransformer;
import com.zrspring.libv2.view.adview.animation.RotateDownTransformer;
import com.zrspring.libv2.view.adview.animation.RotateUpTransformer;
import com.zrspring.libv2.view.adview.animation.TabletTransformer;
import com.zrspring.libv2.view.adview.animation.ZoomInTransformer;
import com.zrspring.libv2.view.adview.animation.ZoomOutSlideTransformer;
import com.zrspring.libv2.view.adview.animation.ZoomOutTranformer;

/**
 * @Encoding:UTF-8
 * @ClassName: TransformerAnimationManager
 * @Description: Adview 切换动画管理类
 * @author zrspring
 * @date 2015年9月29日 下午9:56:22
 * @ConputerUserName zrspring
 */

public class ADAnimationManager {
	
	public static final int TF_TYPE_DEFAULT=1;
	public static final int TF_TYPE_ACCORD_ION=2;
	public static final int TF_TYPE_BACKGROUND_TO_FOREGROUND = 3;
	public static final int TF_TYPE_CUBE_IN = 4;
	public static final int TF_TYPE_CUBE_OUT = 5;
	public static final int TF_TYPE_DEPTH_PAGE = 6;
	public static final int TF_TYPE_FLIP_HORIZONTAL = 7;
	public static final int TF_TYPE_FLIP_VERTICAL = 8;
	public static final int TF_TYPE_FOREGROUND_TO_BACKGROUND = 9;
	public static final int TF_TYPE_ROTATE_DOWN = 10;
	public static final int TF_TYPE_ROTATE_UP = 11;
	public static final int TF_TYPE_STACK = 12;
	public static final int TF_TYPE_TABLET = 13;
	public static final int TF_TYPE_ZOOM_IN = 14;
	public static final int TF_TYPE_ZOOM_OUT_SLIDE = 15;
	public static final int TF_TYPE_ZOOM_OUT = 16;
	
	/**
	 * Title: Description:
	 */
	public ADAnimationManager() {
	}
	
	/**
	 * @Title: getTransformer
	 * @Description: 返回一个动画实例
	 * @return
	 * @throws
	 */
	public static PageTransformer getTransformer(int animaType){
		//默认返回默认的动画效果
		PageTransformer ptf = null;
		switch (animaType) {
		case TF_TYPE_DEFAULT:
			ptf = new DefaultTransformer();
			break;
		case TF_TYPE_ACCORD_ION:
			ptf = new AccordionTransformer();
			break;
		case TF_TYPE_BACKGROUND_TO_FOREGROUND:
			ptf = new BackgroundToForegroundTransformer();
			break;
		case TF_TYPE_CUBE_IN:
			ptf = new CubeInTransformer();
			break;
		case TF_TYPE_CUBE_OUT:
			ptf = new CubeOutTransformer();
			break;
		case TF_TYPE_DEPTH_PAGE:
			ptf = new DepthPageTransformer();
			break;
		case TF_TYPE_FLIP_HORIZONTAL:
			ptf = new FlipHorizontalTransformer();
			break;
		case TF_TYPE_FLIP_VERTICAL:
			ptf = new FlipVerticalTransformer();
			break;
		case TF_TYPE_FOREGROUND_TO_BACKGROUND:
			ptf = new ForegroundToBackgroundTransformer();
			break;
		case TF_TYPE_ROTATE_DOWN:
			ptf = new RotateDownTransformer();
			break;
		case TF_TYPE_ROTATE_UP:
			ptf = new RotateUpTransformer();
			break;
		case TF_TYPE_ZOOM_IN:
			ptf = new ZoomInTransformer();
			break;
		case TF_TYPE_TABLET:
			ptf = new TabletTransformer();
			break;
		case TF_TYPE_ZOOM_OUT_SLIDE:
			ptf = new ZoomOutSlideTransformer();
			break;
		case TF_TYPE_ZOOM_OUT:
			ptf = new ZoomOutTranformer();
			break;
		default:
			ptf = new DefaultTransformer();
		}	
		return ptf;
	};

}
